<?php

/*
 * 
 */

namespace Ruler;

use Ruler\RuleBuilder;

foreach (glob("src/Ruler/*.php") as $filename)
{
    include_once $filename;
}
foreach (glob("src/Ruler/Operator/*.php") as $filename)
{
    include_once $filename;
}


$rb = new RuleBuilder;

$a = $rb['a'];
$b = $rb['b'];
 

// Create a Rule with an $a == $b condition
$aEqualsB = $rb->create($a->equalTo($b));

// Create another Rule with an $a != $b condition
$aDoesNotEqualB = $rb->create($a->notEqualTo($b));


 $eitherOne = $rb->create($rb->logicalOr($aEqualsB, $aDoesNotEqualB));

// Just to mix things up, we'll populate our evaluation context with completely
// random values...
$context = new Context(array(
    'a' => rand(),
    'b' => rand(),
));

// Hint: this is always true!
$eitherOne->evaluate($context);
?>
